<!--<?php
$btns = array();
$db_pwcode && $btns[] = 'pwcodeIcon';
$db_setform && $btns[] = 'setformIcon';
$db_windmagic && $allowUseMagic && $btns[] = 'magicIcon';
($db_xiami_music_open && isset($db_apps_list['11']) && $db_apps_list['11']['status'] == 1) && $btns[] = 'musicIcon';
count($btns) > 2 && $btns = array_merge(array_slice($btns, 0, 2), array('br'), array_slice($btns, 2));
$btns = $btns ? ",'" . implode(' ', $btns) . "'" : '';
$fileBtn = ($db_allowupload && $_G['allowupload']) ? ' fileBtn' : '';

$imageConfigTabs = array();
($db_allowupload && $_G['allowupload']) && $imageConfigTabs[] = 'local';
($db_phopen && $winduid) && $imageConfigTabs[] = 'album';
$imageConfigTabs[] = 'network';
$imageConfigTabs = "'" . implode("','", $imageConfigTabs) . "'";
print <<<EOT
-->
<link rel="stylesheet" type="text/css" href="js/breeze/editor/style/style.css" />
<textarea id="textarea" name="atc_content" class="B_textarea" tabindex="200">{$atc_content}</textarea>
<script src="$db_htmdir/js/face.js"></script>
<script>var BREEZE_BASE_PATH = getBaseUrl() + 'js/breeze/';</script>
<script src="js/breeze/core/base.js"></script>
<script type="text/javascript">
function isEmptyObject(obj){
	for (var name in obj) return false;
	return true;
}
var attachConfig = {
		'attachnum' : parseInt('$db_attachnum'),
		'list' : {{$attach}},
		'sell' : {ifopen : '$htmlsell', price : '$db_sellset[price]', income : '$db_sellset[income]', credit : $sellCredit},
		'enhide' : {ifopen : '$htmlhide', credit : $enhideCredit},
		'ifhide' : '$attachHide',
		'postData' : {fid : '$fid'},
		'filetype' : $attachAllow
	},
	imageConfig = {
		tabs : [$imageConfigTabs],
		url : 'pweditor.php?action=image',
		filetype : $imageAllow
	},
	charset = '$db_charset',
	editor,
	toolbar = [
		'fontSelector sizeSelector br boldIcon italicIcon underlineIcon strikethroughIcon foreColor backColor removeformat',
		'leftIcon centerIcon rightIcon pgformatIcon br olIcon ulIcon indentIcon outdentIcon',
		'hrIcon quoteIcon codeIcon sellIcon postIcon br linkIcon unlinkIcon tableIcon undoIcon redoIcon',
		'faceBtn photoBtn{$fileBtn} musicBtn videoBtn'{$btns}
	],
	mini = 'fontSelector sizeSelector boldIcon italicIcon underlineIcon foreColor linkIcon leftIcon centerIcon rightIcon faceBtn photoBtn fileBtn';
B.require('editor.editor', 'editor.ubb', function(B){
	editor = B.editor(B.$('#textarea'), toolbar, mini, {
		'currentMode' : FetchCookie('editmode') == 1 ? 'UBB' : 'default',
		'isSaveMode' : true,
		'isUBB' : ('{$htmcheck}' == 'checked') ? false : true
	});
	if (!isEmptyObject(attachConfig.list)){
		var fileIcon = B.$('.B_fileIcon', editor.area).parentNode;
		B.insertAfter(B.createElement('<div class="B_attachn"><div></div></div>'), fileIcon);
	}
});
</script>
<!--
EOT;
?>